package com.basej.mp.controller;


import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.basej.mp.entity.Address;
import com.basej.mp.entity.User;
import com.basej.mp.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baseJ
 * @since 2024-03-02
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @Autowired
    IAddressService addressService;

    @RequestMapping("/get")
    public Address getAddr(Long id){
        Address address = addressService.getById(id);
        Db.getById(61,Address.class);
        return address;
    }

    @RequestMapping("/db")
    public Address getByDb(Long id){
        return Db.getById(id,Address.class);
    }


    @RequestMapping("/getuser")
    public User getUserByDb(Long id){
        return Db.getById(id,User.class);
    }

}
